// Copyright (C) 2010 Razvan Constantin <razvan.constantin@rconst.net>
//
// This file is part of FileBow.
//
// FileBow is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// FileBow is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FileBow.  If not, see <http://www.gnu.org/licenses/>.

// Declaration of NavigateDlg class.

#ifndef FILEBOW_UI_NAVIGATE_DLG_H__
#define FILEBOW_UI_NAVIGATE_DLG_H__

#include <gtk/gtk.h>

namespace filebow {
class Navigator;

/**
 * Dialog for file navigation.
 */
class NavigateDlg {

  /**
   * Constructor.
   * @param fileNavigator The logic for file navigation. Not owned.
   */
  public: NavigateDlg(Navigator* navigator);

  /**
   * Destructor.
   */
  public: ~NavigateDlg();

  /**
   * Shows the dialog and opens the selected document.
   */
  public: void Show();

  /**
   * Initializes the list store model to use with gtk tree view.
   */
  private: void InitTreeStore();

  /**
   * Initializes the gtk tree in dialog.
   */
  private: void InitTree();

  /**
   * Initializes file navigator dialog.
   */
  private: void InitDialog();

  /**
   * Forces a rescan of the paths.
   */
  public: void Rescan();

  /**
   * Applies filter and updates the tree content.
   */
  public: void Update();

  /**
   * Updates the tree content from the file navigator.
   */
  private: void UpdateTreeStore();

  /** FileNavigator instance. Not owned. */
  private: Navigator* mNavigator;

  /** GtkEntry for the filter text. Owned by the dialog. */
  private: GtkWidget* filter;

  /** List model for tree view. Owned by tree. */
  private: GtkListStore* treeStore;

  /** GtkWidget for tree view. Owned by tree. */
  private: GtkWidget* tree;

  /** The gtk dialog. */
  private: GtkDialog* dialog;
};

} // namespace filebow

#endif // FILEBOW_UI_NAVIGATE_DLG_H__
